#ifndef TOD_ITF_H_
#define TOD_ITF_H_

//#include "hal/ptp_time_itf.h"

#define TAI_LEN         28
#define TAI_BUF_LEN     60

/** Holds TOD and interface */
typedef struct tod_itf_t tod_itf_t;
struct tod_itf_t {
    int32_t file_desc;                 /**< file descriptor of receiving interface  */
    char    tai_str[TAI_BUF_LEN];       /**< received string ( TAI = Temps Atomique International) */
    int16_t pos;                       /**< pos in tai_str */
    //ptp_time_t time;                 /**< received and checked ptp time */
};

int16_t tod_itf_open( tod_itf_t *tod );
int16_t tod_itf_get_tai( tod_itf_t *tod );
void tod_itf_print_tai( tod_itf_t *tod );
int16_t tod_itf_get_seconds( tod_itf_t *tod );
int16_t tod_itf_write_tsu( tod_itf_t *tod );


#endif /*TOD_ITF_H_*/
